user_input=input("请输入一段文字:")
with open("D:\\http.txt","w",encoding="utf-8")as f:
    f.write(user_input)
    print("文件已保存到D:\\http文件中。")